﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Student
{
    public partial class Main : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void generate_Click(object sender, EventArgs e)
        {
            string fName = this.fNameTxt.Text;
            Literal fNameLit = new Literal();
            fNameLit.Text = fName + "<br/>";
            this.myPH.Controls.Add(fNameLit);

            string lName = this.lNameTxt.Text;
            Literal lNameLit = new Literal();
            lNameLit.Text = lName + "<br/>";
            this.myPH.Controls.Add(lNameLit);

            string fNum = this.fNumberTxt.Text;
            Literal fNumLit = new Literal();
            fNumLit.Text = fNum + "<br/>";
            this.myPH.Controls.Add(fNumLit);

            string uni = this.universityDDL.SelectedValue;
            Literal uniLit = new Literal();
            uniLit.Text = uni + "<br/>";
            this.myPH.Controls.Add(uniLit);

            string cpe = this.specialtyDDL.SelectedValue;
            Literal cpeLit = new Literal();
            cpeLit.Text = cpe + "<br/>";
            this.myPH.Controls.Add(cpeLit);

            int[] indices = this.coursesLB.GetSelectedIndices();
            foreach (var ind in indices)
            {
                Literal tmp = new Literal();
                tmp.Text = this.coursesLB.Items[ind] + "<br/>";
                this.myPH.Controls.Add(tmp);
            }
        }
    }
}